<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>敢敢二手商城</title>
<link type="text/css" href="css/css.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/js.js"></script>
</head>

<body style=" background:#FFF;">
 <div class="loginLogo">
  <div class="logoMid">
   <h1 class="logo" style="height:71px;padding-top:10px;"><a href="index.html"><img src="images/04.jpg" width="241" height="71" /></a></h1>
   <div class="loginReg">
    还没有商城账号?&nbsp;<a href="reg.html">点击注册</a>
   </div><!--loginReg/-->
  </div><!--logoMid/-->
 </div><!--loginLogo/-->
 <div class="loginBox">
  <div class="loginLeft">
   <img src="images/logoinimg.jpg" width="716" height="376" />
  </div><!--loginLeft/-->
  <form class="loginRight" id="LoginForm">
   <h2>客户登录</h2>
   <h3>用户名</h3>
   <input type="text" class="name" id="username" name="username"/>
   <h3>密码</h3>
   <input type="password" class="pwd" name="password"/>
   <div class="zhuangtai">
    <input type="checkbox" checked="checked" /> 保存密码
   </div><!--zhuangtai/-->
   <div class="subs">
    <input type="image" src="images/sub.jpg" class="submit" />
   </div>
  </form><!--loginRight/-->
  <div class="clears"></div>
 </div><!--loginBox/-->
</body>
<script>
  $(".submit").click(function () {
    $.ajax({
     type: 'POST',
     url: 'http://localhost:8080/api/login',
     data: $("#LoginForm").serialize(),
     success: function () {
      alert("登录成功");
      window.location.href = "/vip.html?username="+$("#username").val();
     },
     error: function () {
      alert("登陆失败")
     }
    })
  })
</script>
</html>
